package com.cyys.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cyys.entity.HomeImg;
import com.cyys.entity.HomePage;
import com.cyys.mapper.HomePageMapper;
import com.cyys.response.Result;
import com.cyys.service.HomeImgService;
import com.cyys.service.HomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Administrator
 * @description HomePageController
 * @date 2022-05-26 7:41
 */
@RestController
@RequestMapping("/home")
public class HomePageController {
    @Autowired
    private HomePageService homePageService;

    @Autowired
    private HomePageMapper homePageMapper;

    @GetMapping("/home_page")
    public Result home_swiper(){
        List<HomePage> HomePage = homePageService.list();

        return Result.ok().data("HomePage",HomePage);
    }

    @GetMapping("/home_img")
    public Result home_img(){
        //创建对象
        QueryWrapper<HomePage> wrapper = new QueryWrapper<>();
        wrapper.like("remark","拼单");
        List<HomePage> HomePage = homePageMapper.selectList(wrapper);
        return Result.ok().data("HomePage",HomePage);
    }


}
